import { Route, Routes } from "react-router";
import AppLayout from "@/layouts/AppLayout";
import Dashboard from "./views/Dashboard";
import { BrowserRouter } from "react-router";
import { routes } from "@/config/routes";
import About from "./views/About";
import Splashscreen from "./views/Splashscreen";
import SettingView from "./views/Settings";
import SettingLayout from "./layouts/SettingLayout";
import { StoreProvider } from "./store";

export default function App() {
  return (
    <StoreProvider>
      <BrowserRouter>
        <Routes>
          <Route path={routes.splashscreen} element={<Splashscreen />} />

          <Route element={<AppLayout />}>
            <Route index element={<Dashboard />} />

            <Route element={<SettingLayout />}>
              <Route index path={routes.settings} element={<SettingView />} />
              <Route path={routes.about} element={<About />} />
            </Route>
          </Route>
        </Routes>
      </BrowserRouter>
    </StoreProvider>
  );
}
